What's a 'shall' statement

Doing DoD specification work and must count the 'shalls' in a module ..err.. actually count the objects with shall. I figure to write a 'bool fHasShall(string Text)' function that determines if there is a 'shall' statement in the raw text. I'd like this function to detect actual 'shall' words, EXCLUDE such things as:

[] messhall and shallows
[] 'shall' or "shall", as in "Statements that say 'shall' are requirements.".

I'd like it to INCLUDE such things as:

[] Shall SHALL shall
[] "When A the System shall:"
[] "When A the System shall"
[] "... as follows:.."
Shall do A
Shall do B.
[] "1. Shall do A."

I don't believe I've thought of everthing.

Implementation: right now I think I want to find case-insensitive 'shall' that is not preceeded nor followed by an alpha-numeric character (A-Z a-z 0-9). Preceeded by nothing, tabs, periods are OK. Followed by nothing, punctuation, white space is OK.

What do you think?

>Louie

Later on, perhaps I can write a script that finds shall sentences, thus recommending when big paragraphs need to be broken up.
llandale - Wed Apr 08 12:22:53 EDT 2009

Re: What's a 'shall' statement
David_G_Bond - Wed Apr 08 15:04:09 EDT 2009

Louie,

There is a buffer function keyword that will do the job. Set the string equal to the buffer and then use keyword on it.

Re: What's a 'shall' statement
David_G_Bond - Wed Apr 08 15:06:11 EDT 2009

I forgot to mention that you can use the function upper to change all letters to upper case or lower to change all letters to lower case before you convert the string to a buffer. Then you don't have to worry about cases.

Re: What's a 'shall' statement
Rolan - Fri Apr 17 12:08:44 EDT 2009

Might consider using a regular expression.
Something like this should do the job:

Regexp hasShall = regexp "^a-zA-Z0-9SsHhAaLlLl^a-zA-Z0-9"

Re: What's a 'shall' statement
Rolan - Fri Apr 17 12:15:26 EDT 2009

Rolan - Fri Apr 17 12:08:44 EDT 2009
Might consider using a regular expression.
Something like this should do the job:

Regexp hasShall = regexp "^a-zA-Z0-9SsHhAaLlLl^a-zA-Z0-9"

That post didn't work so well.

Here is the Regexp in an attachment.
Attachments

attachment_14242074_hasShall_Regexp.txt

Re: What's a 'shall' statement
Tony_Goodman - Mon Apr 20 03:09:40 EDT 2009

Rolan - Fri Apr 17 12:15:26 EDT 2009
That post didn't work so well.

Here is the Regexp in an attachment.

I am afraid that your regular expression will not do the job.

Use the keyword function as suggested. Also take a look at the contains function.

I am sure using these would be faster that using regular expressions anyway.